import requests
import json

url = "https://5374c136-db01-4155-98c4-fd157d6a08e4.mock.pstmn.io/login"
data = {"username": "admin","password": "12345678"}
headers = {"Content-Type": "application/json","Accept": "application/json"}



def api_run(way,url,head,data):
    if way=="post":
        response = requests.post(url=url, data=json.dumps(data), headers=head)
        return [response.status_code,response.text]
    else:
        response = requests.get(url=url, data=json.dumps(data), headers=head)
        return [response.status_code, response.text]
aa=api_run("post",url,headers,data)
print(aa)